-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[refactor] call WebDriverException constructor instead of using reflection #16763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
User description
🔄 Types of changes
PR Type
Enhancement
Description
Replace reflection-based exception construction with method references
Add generic type parameter to
W3CErrorfor type safetyUse
Function<String, T>for exception constructors instead ofClassRemove
java.lang.reflect.Constructorimport and addjava.util.function.FunctionDiagram Walkthrough
File Walkthrough
ErrorCodec.java
Refactor exception construction from reflection to method referencesjava/src/org/openqa/selenium/remote/ErrorCodec.java
java.lang.reflect.Constructorimport and addedjava.util.function.FunctionimportW3CErrorclass generic with type parameterWebDriverException>Changed
W3CErrorconstructor to acceptFunctioninstead ofClassReplaced reflection-based exception instantiation in
decode()methodwith direct function application
Updated all 28 error definitions to use method references (e.g.,
ScriptTimeoutException::new) instead of class literalsChanged field visibility from public to private in
W3CErrorclassAdded@SafeVarargsand@SuppressWarningsannotations to handle generictype reification